<script>

$(function(){
	$("#create_ticket").click(function(){
		var good_arr = new Array;
		$("#goods_list input").each(function(){
			if($(this).prop('checked')){
				good_arr.push($(this).next().html())
			}
		})

		console.log(good_arr)
		
		
		$.ajax({
		   type: "POST",
		   url: "/center/ajaxCreateTicket.html",
		   data: "data="+good_arr,
		   success: function(msg){
			   if(msg==0){
				   swal_alert("创建失败",0)
				   
			   }else{
				var str = "<a target='_blank' href='http://weixin_online/app/index.php?i=3&c=entry&do=open_ticket&m=xf_ticket&number="+$.trim(msg)+"'>开票地址</a>";
				$("#link").html(str);
				var src = "http://qr.liantu.com/api.php?text=http://weixin.xiangfubao.com.cn/app/index.php?i=4%26c=entry%26do=open_ticket%26m=xf_ticket%26number="+$.trim(msg);
				$("#img").attr("src",src)
				swal_alert("创建成功",1)
				
			   }
			
		   }
		});
		
		
		
		
	})	
	
	

})


</script>